
#include "CAdControlBlockImpl.h"
#include "ParamControlDescriptorGenerator.h"

CAdControlBlockImpl::CAdControlBlockImpl(std::string strParamFile)
{
	ParamControlDescriptorGenerator *pgenerator =new ParamControlDescriptorGenerator(strParamFile);
	vector<IDescriptorData*> vectorDescriptor=pgenerator->GeneratorControlDescriptor();
	for (int i=0;i<(int)vectorDescriptor.size();i++)
	{
		m_cContainer.AddDescriptor(vectorDescriptor[i]);
	}
	
	if (pgenerator != NULL)
	{
		delete pgenerator;
		pgenerator = NULL;
	}
}

CAdControlBlockImpl::~CAdControlBlockImpl(void)
{
	m_cContainer.ClearDescriptor();
}
void CAdControlBlockImpl::GetDescriptorData(unsigned char* buff  , int &len)
{
	m_cContainer.GetDescriptorData(buff,len);
}
 
